home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ahoy 1988 October
/
Ahoy_Magazine_88-10_1988_Double_L.d64
/
Clock Segments
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
1KB
|
40 lines
0 poke53280,6:poke53281,0
2 ti$="000000":dimch(23):ul=2:print"[147]"
3 data2,0,1,4,7,8:data2,3,5,6,9:data5,6,2,4,3,7
4 fori=0to10:readnm(i):next:restore:fori=0to10:readp$(i):next
5 fori=0to5:readsa(i):next
10 forx1=0to2:c1=sa(x1)
15 forx2=0toul:c2=c1+sa(x2)
20 forx3=0to3:c3=c2+sa(x3):ifc3>15then55
25 forx4=0to5:c4=c3+sa(x4):ifc4>17then50
30 forx5=0to3:c5=c4+sa(x5):ifc5>19then45
35 forx6=0to5:c6=c5+sa(x6):ifc6=21then70
40 next
45 next
50 next
55 next
60 next
65 ul=5:next:goto200
70 hn=nm(x1)*10:la=x2:lb=x2:ifx2=0thenla=6:lb=10
71 ifx2=0andx1=0thenla=6:lb=7
75 lc=x3:ld=x3:ifx3=0thenlc=6:ld=8
80 le=x4:lf=x4:ifx4=0thenle=6:lf=10
85 lg=x5:lh=x5:ifx5=0thenlg=6:lh=8
90 li=x6:lj=x6:ifx6=0thenli=6:lj=10
95 fory2=latolb:hc=hn+nm(y2)
96 fory3=lctold:fory4=le tolf
98 y5=lg
99 y6=li
100 print""p$(x1);p$(y2);":";p$(y3);p$(y4);":";p$(y5);p$(y6)
101 ch(hc)=ch(hc)+1:cd=cd+1
102 iflj>y6theny6=y6+1:goto100
103 iflh>y5theny5=y5+1:goto99
105 next:next:next:goto40
200 fori=0to23:printi,ch(i):next:printcd:printti$:end
300 rem ==================================
310 rem commodares problem #52-3 :
320 rem clock segments
330 rem solution by
340 rem craig ewert
350 rem ==================================